/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package systole.processor.correlation;

import java.math.BigDecimal;

/**
 *
 * @author jmj
 */
public class CorrelationResult implements Comparable<CorrelationResult> {

    private Integer segmentNumber;
    private BigDecimal correlation;

    /**
     * 
     * @param segmentNumber
     * @param correlation
     */
    public CorrelationResult(int segmentNumber, BigDecimal correlation) {
        this.segmentNumber = segmentNumber;
        this.correlation = correlation;
    }

    /**
     * @return the segmentNumber
     */
    public Integer getSegmentNumber() {
        return this.segmentNumber;
    }

    /**
     * @param segmentNumber the segmentNumber to set
     */
    public void setSegmentNumber(Integer segmentNumber) {
        this.segmentNumber = segmentNumber;
    }

    /**
     * @return the correlation
     */
    public BigDecimal getCorrelation() {
        return this.correlation;
    }

    /**
     * @param correlation the correlation to set
     */
    public void setCorrelation(BigDecimal correlation) {
        this.correlation = correlation;
    }

    public int compareTo(CorrelationResult o) {
        int comp = this.correlation.compareTo(o.correlation);
        return ((comp == 0) ? this.segmentNumber.compareTo(o.segmentNumber) : comp);
    }

    @Override
    public String toString() {
        return "Segment Number: "+this.segmentNumber.toString()+" Correlation: "+this.correlation.toString();
    }


}
